#ifndef CPP_TEXT_SCROLL_VIEW_H
#define CPP_TEXT_SCROLL_VIEW_H

#include <widget/ScrollView.h>

class Font;
class Rect;

//@brief 纯文本的滑动控件
//@author cvte
class TextScrollView : public ScrollView {
   public:
    TextScrollView();
    ~TextScrollView();

    void setText(const char* text, Font& font, Rect rect, int color, TextAlignStyle style, int lineSpacingExtra);

   private:
    const char* mText = nullptr;
    Font* mTextFont = nullptr;
    Rect mTextRect;
    TextAlignStyle mTextAlignStyle;
    int mTextColor;
    int mLineSpacingExtra;

    void onDrawContent();  //绘制内容
};
#endif